package io;

import java.io.*;

public class PrintStreamDemo {

    public static void main(String[] args) throws FileNotFoundException {
        OutputStream out = new FileOutputStream(new File("test.txt"));
        PrintStream printStream = new PrintStream(out);
        printStream.println(10);
        printStream.println("abc");
        printStream.println(true);
        try {
            printStream.write("wenjian".getBytes());
        } catch (IOException e) {
            e.printStackTrace();
        }
        printStream.printf("\n%s\t%d\t%.2f","abc" , 100 , 1.876);
        printStream.close();
    }
}
